<?php

class DocmanHelper
{
	public static $submenu = array(
		array('text' => 'Home', 'link' => 'task=cpanel', 'view' => 'cpanel'),
		array('text' => 'Files', 'link' => 'section=files', 'view' => 'files'),
		array('text' => 'Documents', 'link' => 'section=documents', 'view' => 'documents'),
		array('text' => 'Categories', 'link' => 'section=categories', 'view' => 'categories'),
		array('text' => 'Groups', 'link' => 'section=groups', 'view' => 'groups'),
		array('text' => 'Licenses', 'link' => 'section=licenses', 'view' => 'licenses'),
		array('text' => 'Statistics', 'link' => 'task=stats', 'view' => 'stats'),
		array('text' => 'Download Logs', 'link' => 'section=logs', 'view' => 'logs'),
		array('text' => 'Config', 'link' => 'section=config', 'view' => 'config'),
		array('text' => 'Themes', 'link' => 'section=themes', 'view' => 'themes'),
	);
	public static function addSubmenu($view, $task) 
	{
		if (empty($view) and empty($task)) {
			$view = 'cpanel';
		}
		
		foreach (self::$submenu as $menu) {
			JSubMenuHelper::addEntry(
				JText::_($menu['text']),
				'index.php?option=com_docman&'.$menu['link'],
				$view == $menu['view'] || $task == $menu['view']
			);
		}
	}
}